﻿using System;

using NUnit.Framework;
using Spring.Testing.NUnit;

using VisualAgile.Model;
using VisualAgile.IDAL;

namespace VisualAgile.DAL.Tests
{
    [TestFixture]
    public class StatusDaoTest : AbstractTransactionalDbProviderSpringContextTests
    {
        protected override string[] ConfigLocations
        {
            get
            {
                return new String[] { "objects.xml" };
            }
        }

        protected IStatusDao StatusDao
        {
            get
            {
                return applicationContext.GetObject("StatusDao") as IStatusDao;
            }
        }

        [Test]
        public void SaveStatusTest()
        {
            Status status = new Status();            
            
            status.CreateTime = DateTime.Now;
            status.Name = "New Status"; // hard coded default status text            

            StatusDao.Save(status);
            transactionManager.Commit(transactionStatus);
        }       
    }
}
